<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>画圆</title>
	</head>
	
	<canvas id="myCanvas"></canvas>
	<script type="text/javascript">
//正方形
	var canvas=document.getElementById('myCanvas');
	var ctx=canvas.getContext('2d');
	ctx.fillStyle='rosybrown';
	ctx.fillRect(100,0,100,100);
//圆
	var c=document.getElementById("myCanvas");
	var cxt=c.getContext("2d");
	cxt.fillStyle="red";
	cxt.beginPath();
	cxt.arc(100,100,50,0,Math.PI*2);
	      
	cxt.closePath();
	cxt.fill();
</script>
	<body>
	
	</body>
</html>
